#ifndef __SAMPLE_VIO_H__
#define __SAMPLE_VIO_H__

#include "hi_common.h"
#include "queue_data.h"

#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif /* End of #ifdef __cplusplus */

#ifndef SAMPLE_PRT
#define SAMPLE_PRT(fmt...)   \
    do {\
        printf("[%s]-%d: ", __FUNCTION__, __LINE__);\
        printf(fmt);\
    }while(0)
#endif

#ifndef PAUSE
#define PAUSE()  do {\
        printf("---------------press Enter key to exit!---------------\n");\
        getchar();\
    } while (0)
#endif

typedef struct {
    VI_PIPE ViPipe ;
    VI_CHN  ViChn ;
    int     sock;
    const char *outputFile;
} ThreadParams;

#pragma pack(1)
typedef struct {
    uint16_t bfType;
    uint32_t bfSize;
    uint16_t bfReserved1;
    uint16_t bfReserved2;
    uint32_t bfOffBits;
} BMPFileHeader;

typedef struct {
    uint32_t biSize;
    int32_t  biWidth;
    int32_t  biHeight;
    uint16_t biPlanes;
    uint16_t biBitCount;
    uint32_t biCompression;
    uint32_t biSizeImage;
    int32_t  biXPelsPerMeter;
    int32_t  biYPelsPerMeter;
    uint32_t biClrUsed;
    uint32_t biClrImportant;
} BMPInfoHeader;

typedef struct {
    uint8_t rgbBlue;
    uint8_t rgbGreen;
    uint8_t rgbRed;
    uint8_t rgbReserved;
} RGBQuad;

typedef struct 
{
   HI_U8*  pu8VirAddr_uv;
   HI_U32  uv_size;
   HI_U32  thread_count;
//    CircularQueue queue;
   pthread_mutex_t mutex;
}SendZstdData_S;

#pragma pack()


void SAMPLE_VIO_HandleSig(HI_S32 signo);
HI_S32 SAMPLE_VIO_ViOnlineVpssOnlineRoute(HI_U32 u32VoIntfType);
HI_S32 SAMPLE_VIO_WDR_LDC_DIS_SPREAD(HI_U32 u32VoIntfType);
HI_S32 SAMPLE_VIO_ViDoublePipeRoute(HI_U32 u32VoIntfType);
HI_S32 SAMPLE_VIO_ViWdrSwitch(HI_U32 u32VoIntfType);
HI_S32 SAMPLE_VIO_ViVpssLowDelay(HI_U32 u32VoIntfType);
HI_S32 SAMPLE_VIO_Rotate(HI_U32 u32VoIntfType);
HI_S32 SAMPLE_VIO_FPN(HI_U32 u32VoIntfType);

HI_S32 SAMPLE_VIO_ResoSwitch(HI_U32 u32VoIntfType);
HI_S32 SAMPLE_VIO_ViDoubleWdrPipe(HI_U32 u32VoIntfType);
HI_S32 SAMPLE_VIO_SetUsrPic(HI_U32 u32VoIntfType);

#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* End of #ifdef __cplusplus */

#endif /* End of #ifndef __SAMPLE_VIO_H__*/
